package com.test.utils;

import com.test.config.RootConfiguration;
import com.test.dao.UserMapper;
import com.test.entity.AuthUser;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class demo {
    @Test
    public void test(){
        ApplicationContext context=new AnnotationConfigApplicationContext(RootConfiguration.class);
        UserMapper mapper=context.getBean(UserMapper.class);
        AuthUser user=new AuthUser(10,"ll","ll","user");
        System.out.println(mapper.registerUser(user));
        //mapper.addStudentInfo();
    }
    @Test
    public void test2(){
        BCryptPasswordEncoder encoder=new BCryptPasswordEncoder();
        System.out.println(encoder.encode("root"));
    }
}
